<div class="row">
	<div class="col-md-6">
		<div class="panel panel-primary full">
			<div class="panel-heading">
				<div class="panel-title">
					控制端 <span class="badge pull-right">${ctrls.~size}</span>
				</div>
			</div>
			<div class="panel-body">
				<table id="example" class="table table-bordered" style="width: 100%">
					<!-- table-striped  -->
					<thead>
						<tr>
							<th class="center">帐号</th>
							<th class="center">IP地址</th>
							<th class="center">设备端</th>
							<th class="center">创建时间</th>
						</tr>
					</thead>
					<tbody>
					<%for(var item in ctrls){%>
						<tr>
							<td>${item.account}</td>
							<td>${item.clientIp}</td>
							<td>${item.device}</td>
							<td>${longToDate(item.bindTime)}</td>
						</tr>
					<%}%>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<div class="col-md-6">
		<div class="panel panel-auxiliary full">
			<div class="panel-heading">
				<div class="panel-title">
					设备端 <span class="badge primary pull-right">${devices.~size}</span>
				</div>
			</div>
			<div class="panel-body">
				<table id="example" class="table table-bordered" style="width: 100%">
					<!-- table-striped  -->
					<thead>
						<tr>
							<th class="center">站码</th>
							<th class="center">IP地址</th>
							<th class="center">是否主令</th>
							<th class="center">主令控制端</th>
							<th class="center">创建时间</th>
						</tr>
					</thead>
					<tbody>
					<%for(var item in devices){%>
						<tr>
							<td>${item.account}</td>
							<td>${item.clientIp}</td>
							<td class="center">${item.master ? "是" : "否"}</td>
							<td>${item.controller}</td>
							<td>${longToDate(item.bindTime)}</td>
						</tr>
					<%}%>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>

<script>
    
    $(window).resize(function() {
        $('.panel.full>.panel-body').each(function() {
            var height = $(this).height();
            var top = $(this).offset().top;
            var footer = $(this).closest('.full').find('.panel-footer').height();
            footer = footer && footer > 0 ? footer + 12 : 0;
            var winHeight = $(window).height();
            var resetHeight = winHeight - top - footer - 40;
            if(resetHeight > 20 || height < resetHeight){
                $(this).height(resetHeight);
            }
        });
        // $('#results').height($(window).height() - $('#results').offset().top - 106);
    });
    setTimeout(function() { $(window).resize(); },200);
    </script>